package day03;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

@WebServlet("/testForward")
public class TestForwardServlet extends HttpServlet {

    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        System.out.println("TestForwardServlet.service()");
//        response.sendRedirect("https://www.baidu.com");
//        request.getRequestDispatcher("https://www.baidu.com").forward(request,response);

        request.getRequestDispatcher("/WEB-INF/a.jsp").forward(request,response);
    }
}
